﻿#ifndef SAVEDEVTOMODELDLG_H
#define SAVEDEVTOMODELDLG_H

#include <QDialog>
#include "db_cfg_g_def.h"
#include "DbCfgFun.h"

namespace Ui {
    class SaveDevToModelDlg;
}

class SaveDevToModelDlg : public QDialog {
    Q_OBJECT
public:
    SaveDevToModelDlg(int AppType, int TableId, unsigned int RecordId, QWidget *parent = 0);
    ~SaveDevToModelDlg();

	void InitShow();

	void InsertDevModel(QString ModeName);
	int InsertYxModel(unsigned int DevModelId);
	int InsertYcModel(unsigned int DevModelId);
	int InsertYkModel(unsigned int DevModelId);
	int InsertYmModel(unsigned int DevModelId);
//	int InsertRlySOEModel(unsigned int DevModelId);
	void	ReleasColumnInfo();

protected:
    void changeEvent(QEvent *e);

protected slots:
	void AffirmBtn();

signals:
	void	UpDateTreeItem_Signal(quint32 RecordId);

private:
	Ui::SaveDevToModelDlg *ui;

	int		m_AppType;
	int		m_TableId;
	unsigned int		m_RecordId;
	QString		m_DevName;
	int		m_YxNum;
	int		m_YcNum;
	int		m_YkNum;
	int		m_YmNum;
	int		m_SetNum;
	
	int		 m_columnNum;
	int		 m_RecordLength;
	cColumn_Info *m_pColumnInfo;
	int		 *m_pDataOffset;
	
};

#endif // SAVEDEVTOMODELDLG_H
